package yawning.mew.cat;

import yawning.mew.sim.SimulationEvent;

public class EventToTT extends SimulationEvent {
	private CatModelSimState mState;
	private double cooldownAt = 0.0;
	
	EventToTT(CatModelSimState state) {
		super(state.mSimUtil);
		schedule(0.0);
		mState = state;
	}

	@Override
	public void onExpire() {
		if (cooldownAt > mState.mSimUtil.getSimTime()) {
			mState.mModel.multToTT = 1;
			schedule(cooldownAt - mState.mSimUtil.getSimTime());
		} else {
			mState.mModel.multToTT = 1.15;
			schedule(mState.mModel.tottBuffDuration);
			cooldownAt = mState.mSimUtil.getSimTime() + mState.mModel.tottCDDuration;
		}
	}

}